<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <title> comparewuzi </title>
  <script src="<?php echo Yii::app()->request->baseUrl; ?>/js/jquery.js" type="text/javascript"></script>
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
 </head>
<style type="text/css">
table{border-left: 1px solid #666; border-bottom: 1px solid #666;}
td{border-right:1px solid #666;border-top: 1px solid #666;}
</style>
 <body>
  

<?php 
	
	echo "<table>";
	
				echo "<tr>";
				echo "<td>项目物资编号</td>";
				echo "<td>项目物资名称</td>";
				echo "<td>项目物资描述</td>";
				echo "<td>项目物资价格</td>";		
				echo "<td>比较</td>";
				echo "<td>系统物资编号</td>";
				echo "<td>系统物资名称</td>";
				echo "<td>系统物资描述</td>";
				echo "<td>系统物资价格</td>";	
				echo "<td></td>";
				echo "<td></td>";
			echo "</tr>";
	
	
	foreach ($projectwuziku as $pwuziku){
		foreach ($wuziku as $wuzi){
			$pwuZiId = substr($pwuziku->wuZiId,-7);
			if($wuzi->wuZiId!=$pwuZiId)
				continue;		
			echo "<tr>";
				echo "<td>".$pwuziku->wuZiId."</td>";
				echo "<td>".$pwuziku->name."</td>";
				echo "<td>".mb_substr($pwuziku->detail,0,8,'utf-8')."</td>";
				echo "<td>".$pwuziku->price."</td>";		
				echo "<td>--></td>";
				echo "<td>".$wuzi->wuZiId."</td>";
				echo "<td>".$wuzi->name."</td>";
				echo "<td>".$wuzi->detail."</td>";
				echo "<td>".$wuzi->price."</td>";	
				echo "<td><a href='javascript:void(0)' onclick='right(this,".$pwuziku->id.")'>正确</a></td>";
				echo "<td><a href='javascript:void(0)' onclick='errorIng(this,".$pwuziku->id.")'>错误</a></td>";
			echo "</tr>";
			break;
		}		

	}
	echo "</table>";

?>

 </body>
 
 <script type="text/javascript">
 function right(t,e){
	 $.ajax({
		   type: "POST",
		   url: "/ProjectWuZiKu/resultCompareRight",
		   data: "id="+e,
		   success: function(msg){
		     alert( "Data Saved: " + msg );
		     $(t).parent().parent().hide()
		     //window.location.reload();
		   }
		}); 

 }
 function errorIng(t,e){
	 
	 $.ajax({
		   type: "POST",
		   url: "/ProjectWuZiKu/resultCompareError",
		   data: "id="+e,
		   success: function(msg){
		     alert( "Data Saved: " + msg );
		     $(t).parent().parent().hide()
		     //window.location.reload();
		   }
		}); 

 }
 
 </script>
</html>